<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>企业广告热度广告管理</title>
    <meta name="decorator" content="default"/>
    <%@include file="/WEB-INF/views/include/treeview.jsp" %>
    <script type="text/javascript">
        $(document).ready(function () {
            //$("#name").focus();
            /*$("#inputForm").validate({
                submitHandler: function (form) {
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function (error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });*/
        });

        /* function Play(obj) {
             vid = $("#imgSrc").val();
             window.open("\\${ctx}/adv/hkMediaAdv/mediaPlayPath?videoId=" + vid);
            location.href = "\\${ctx}/adv/hkMediaAdv/mediaPlayPath?videoId=" + vid;
            $(this).attr("href","\\${ctx}/adv/hkMediaAdv/mediaPlayPath?videoId=" + vid);
            alert($(this).attr("href","\\${ctx}/adv/hkMediaAdv/mediaPlayPath?videoId=" + vid));
         }*/
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li><a href="${ctx}/adv/hkEnterpriseHotAdv/">企业广告热度广告列表</a></li>
    <li class="active"><a
            href="${ctx}/adv/hkEnterpriseHotAdv/form?id=${hkEnterpriseHotAdv.id}">企业广告热度广告<shiro:hasPermission
            name="adv:hkEnterpriseHotAdv:edit">${not empty hkEnterpriseHotAdv.id?'修改':'添加'}</shiro:hasPermission>
        <shiro:lacksPermission name="adv:hkEnterpriseHotAdv:edit">查看</shiro:lacksPermission></a></li>
</ul>
<br/>
<form:form id="inputForm" modelAttribute="hkEnterpriseHotAdv" action="${ctx}/adv/hkEnterpriseHotAdv/save" method="post"
           class="form-horizontal">
    <form:hidden path="id"/>
    <sys:message content="${message}"/>
    <div class="control-group">
        <label class="control-label">企业广告：</label>
        <div class="controls">
            <sys:tableSelect id="enterprise" name="enterprise.id" value="${hkEnterpriseHotAdv.enterprise.id}"
                             labelName="enterprise.title"
                             labelValue="${hkEnterpriseHotAdv.enterprise.title}" title="选择广告"
                             url="${ctx}/adv/hkEnterpriseAdv/list?1=1" checked="1"/>
            <span class="help-inline"><font color="red">*</font> </span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">标题：</label>
        <div class="controls">
            <form:input path="title" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
            <span class="help-inline"><font color="red">*</font> </span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">副标题：</label>
        <div class="controls">
            <form:input path="subtitle" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">开始时间：</label>
        <div class="controls">
            <input name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
                   value="<fmt:formatDate value="${hkEnterpriseHotAdv.beginDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">结束时间：</label>
        <div class="controls">
            <input name="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
                   value="<fmt:formatDate value="${hkEnterpriseHotAdv.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">播放时间段：</label>
        <div class="controls">
            <input name="playTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
                   value="${hkEnterpriseHotAdv.playTime}"
                   onclick="WdatePicker({dateFmt:'HH:mm:ss',isShowClear:false});"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">是否给奖励：</label>
        <div class="controls">
            <form:select path="state" class="input-xlarge ">
                <form:option value="" label=""/>
                <form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value"
                              htmlEscape="false"/>
            </form:select>
        </div>
    </div>
    <%--<div class="control-group">
        <label class="control-label">视频：</label>
        <div class="controls">
            <form:input id="imgSrc" path="imgSrc" htmlEscape="false" readonly="true" maxlength="200" class="input-xlarge"/>
            <a href="javascript:" onclick="Play()" class="btn">播放</a>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">视频地址：</label>
        <div class="controls">
            <form:hidden id="aimgSrc" path="aimgSrc" htmlEscape="false" maxlength="200" class="input-xlarge"/>
            <sys:ckfinder input="aimgSrc" type="files" uploadPath="/hkEnterpriseAdv" selectMultiple="false"/>

        </div>
    </div>--%>
    <div class="control-group">
        <label class="control-label">用户：</label>
        <div class="controls">
            <sys:tableSelect id="user" name="user.id" value="${hkEnterpriseHotAdv.user.id}" labelName="user.name"
                             labelValue="${hkEnterpriseHotAdv.user.name}" title="选择用户"
                             url="${ctx}/sys/user/hkUser/list?1=1" checked="1"/>

        </div>
    </div>
    <%--<div class="control-group">
        <label class="control-label">封面图片：</label>
        <div class="controls">
            <form:hidden id="coverImgSrc" path="coverImgSrc" htmlEscape="false" maxlength="200" class="input-xlarge"/>
            <sys:ckfinder input="coverImgSrc" type="images" uploadPath="/hkEnterpriseAdv" selectMultiple="false"/>

        </div>
    </div>--%>
    <div class="control-group">
        <label class="control-label">系统币种：</label>
        <div class="controls">
            <form:select path="currencyType" class="input-xlarge ">
                <form:option value="" label=""/>
                <form:options items="${fns:getDictList('hk_currency_type')}" itemLabel="label" itemValue="value"
                              htmlEscape="false"/>
            </form:select>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">乐币：</label>
        <div class="controls">
            <form:input path="integral" htmlEscape="false" maxlength="11" class="input-xlarge digits required"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">总乐币：</label>
        <div class="controls">
            <form:input path="integralCount" htmlEscape="false" maxlength="11" class="input-xlarge digits required"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">序号：</label>
        <div class="controls">
            <form:input path="imgRank" htmlEscape="false" maxlength="11" class="input-xlarge digits required"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">备注：</label>
        <div class="controls">
            <form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="100" class="input-xxlarge "/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">展示类型：</label>
        <div class="controls">
            <form:select path="showType" class="input-xlarge ">
                <form:option value="" label=""/>
                <form:options items="${fns:getDictList('hk_adv_showType')}" itemLabel="label" itemValue="value"
                              htmlEscape="false"/>
            </form:select>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">内容：</label>
        <div class="controls">
            <form:textarea id="content" htmlEscape="true" path="content" rows="4" maxlength="200"
                           class="input-xxlarge required"/>
            <sys:ckeditor replace="content" uploadPath="/hkEnterpriseHotAdv"/>
        </div>
    </div>
    <div class="form-actions">
        <shiro:hasPermission name="adv:hkEnterpriseHotAdv:edit"><input id="btnSubmit" class="btn btn-primary"
                                                                       type="submit"
                                                                       value="保 存"/>&nbsp;</shiro:hasPermission>
        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
    </div>
</form:form>
</body>
</html>